import { request } from "@/utils/service"
import type * as Notice from "./types/notice"

/** 增 */
export function createNoticeDataApi(data: Notice.CreateOrUpdateNoticeRequestData) {
  return request({
    url: "notice",
    method: "post",
    data
  })
}

/** 删 */
export function deleteNoticeDataApi(ids: string) {
  return request({
    url: `notice/batch?ids=${ids}`,
    method: "delete"
  })
}

// /** 改 */
export function updateNoticeDataApi(data: Notice.CreateOrUpdateNoticeRequestData) {
  return request({
    url: "notice",
    method: "put",
    data
  })
}

/** 查 */
export function getNoticeDataApi(params: Notice.GetNoticeRequestData) {
  return request<Notice.GetNoticeResponseData>({
    url: "notice",
    method: "get",
    params
  })
}
